import { Body, Controller, Get, Post } from '@nestjs/common';
import { DistributionService } from './distribution.service';
import { DistributionConfig } from '@app/db/entity/DistributionConfig';
import { ResponseUtilService } from '@app/response-util';

@Controller('distribution')
export class DistributionController {
    constructor(
        private readonly service:DistributionService
    ){}

    @Post('set/config')
    async setConfig(@Body() dto:DistributionConfig) {
        const r = await this.service.setConfig(dto)
        return ResponseUtilService.successRes(r)
    }

    @Get('get/config')
    async getConfig(@Body() dto:DistributionConfig) {
        const r = await this.service.getConfig()
        return ResponseUtilService.successRes(r)
    }
}
